From 2bd42d61f1a6337e7fae6906c0001e44764c4b25 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 13 Apr 2010 13:40:58 +0100 Subject: [PATCH] sysctl: Fix XEN_SYSCTL_debug_keys error path. Signed-off-by: Keir Fraser --- xen/common/sysctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 1799eb3a94..ba16353266 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -169,12 +169,14 @@ long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) if ( ret ) break; + ret = -EFAULT; for ( i = 0; i < op->u.debug_keys.nr_keys; i++ ) { if ( copy_from_guest_offset(&c, op->u.debug_keys.keys, i, 1) ) - return -EFAULT; + goto out; handle_keypress(c, guest_cpu_user_regs()); } + ret = 0; } break; -- 2.30.2